
struct Uniform {
    ofs1: f32,
    ofs2: f32,
    ofs3: f32,
};

struct Mats {
    MVP: mat4x4f,
    M: mat4x4f
}

struct vin {
    @location(0) pos: vec4f,
}

struct v2f {
    @builtin(position) pos: vec4f,
}

@group(0) @binding(0) var<uniform> mats: Mats;
@group(0) @binding(1) var<uniform> unif: Uniform;

@vertex
fn vert(in: vin) -> v2f {
    var out: v2f;
    var fakeNormal = normalize(in.pos.xyz);
    out.pos = mats.MVP * (in.pos + vec4(fakeNormal, 1) * 0.2);

    return out;
}

@fragment
fn frag(fin: v2f) -> @location(0) vec4f {
    return vec4(unif.ofs1, unif.ofs2, unif.ofs3, 1);
}
